5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
- Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
+ Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-2: True/False Status Indicators

Setting T/F Status Indicators


As part of learning how to specify true/false execution conditions when you design ILF routines, you need to understand how the system sets the internal true/false status indicators. APPX clears (sets to blanks) all five status indicators at the beginning of each event point. This allows each ILF routine to start with a 'clean slate', and enables APPX to set the values based on statement evaluation at runtime. In addition, when you invoke a subroutine using the keyword GOSUB, APPX temporarily clears out the true/false status indicators at the start of the subroutine so they can be used in the GOSUB routine. When control is returned to the ILF routine that invoked the GOSUB (via the keyword RETURN), the system restores the indicators to the values that existed before the GOSUB was invoked.

Only certain statements have the capability to affect the value of internal true/false status indicators. See Table 4-2-1for a complete list of these statements, and refer to the statement keyword in ILF Keyword Reference for a description of how each one operates.

In general, here is how indicator-setting works:

Only the statements included in Table 4-2-1 affect status indicator values, and each of these statements sets a status indicator when it executes.*

The five true/false status indicators are always set from left to right and are referred to as levels 1 through 5, respectively (corresponding to the execution conditions specified in the first five positions of the statement).

Each statement affecting true/false status indicators sets the next level (as designated by the execution conditions) to either T or F, depending on the success or failure of an operation*. The status indicator to be set corresponds to the leftmost execution condition which contains a blank value. In addition, any status indicators to the right of the level being set (i.e., with a higher level number) are automatically cleared. For example, an IF statement with blanks in the first five positions would set level 1 and clear levels 2 through 5.

Whereas the first five positions in the statement format are reserved for specifying execution conditions, statements affecting true/false status indicators (other than GOSUB and RETURN) are limited to a maximum of four non-blank execution conditions. This is because there must be one blank value corresponding to the next status indicator to be set. Once a blank value is specified, any execution conditions to the right must also be blank.

* Exceptions:

Statements with keywords GOSUB, RETURN, AND, and OR affect status indicator values but behave a little differently.

As described above, GOSUB stores the current value of all status indicators and clears all indicator levels prior to invoking the subroutine. RETURN restores the original values before code following the GOSUB is resumed.

AND and OR modify or preserve the current value of the next indicator level, rather than simply setting it, since this indicator value (as already set by a preceding statement) must be considered in evaluating the AND and OR statements. Note that, for proper execution, AND and OR statements must be subject to the same execution conditions as the statement (normally an IF) which originally sets the shared indicator level.

If execution conditions are specified on a COPY statement, behavior can get a little confusing. This is because, at runtime, the COPY statement's execution conditions become the leftmost execution conditions of every statement copied (that is, they are inserted in front of specified values). It is best to avoid this situation since you may forget about the conditions to be inserted at runtime and thus end up dropping some non-blank execution conditions or status indicators. Worse, instead of getting a runtime error, the routine may simply execute improperly. You can avoid potential grief by using a GOSUB or SUBR statement instead of a COPY if you need to specify execution conditions.

Application Design Manual                                         "Powered by Appx Software"

520

©2006 By APPX Software, Inc. All Rights Reserved